<template>
  <div>
    <h3>我是子组件</h3>
    <div>
      <h3>props传参</h3>
      <!-- <p>
        {{ count }}
      </p> -->
      <!-- <button @click="add(1)">add</button> -->
      <!--  sync修饰符的作用-->
      <!-- <button @click="$emit('update:count', count + 1)">add</button> -->
      <!-- v-model 数据双向绑定 -->
      <p>{{ value }}</p>
      <button @click="$emit('input', value + 1)">add</button>
    </div>
  </div>
</template>

<script>
export default {
  name: "Child",
  // props: ["count"],
  props: ["value"],
  mounted() {
    // console.log(this.$listeners);
    // 找到当前组件树的顶端
    console.log(this.$root);
    // 找到自己所有的子组件
    console.log(this.$children);
  },
};
</script>

<style>
</style>
